package com.million.base;

import com.million.base.enums.EvictionType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author miki
 * @Date 2022/1/22 0:28
 * @Explain 封装淘汰策略选择和范围
 */
@Slf4j
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EvictionRange {

    private EvictionType evictionType;

    private Class evictionStrategyClass;

    public boolean select(String key){
        return evictionType.name().equals(key);
    }
}
